package com.hd.mapper;

import com.hd.controller.dto.UserDto;
import com.hd.pojo.Role;
import com.hd.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by 1 on 2017/11/16.
 */
public interface UserMapper extends BaseMapper<User>{

    User loginByNameAndPwd(@Param("loginName") String loginName,@Param("password") String password);

    List<User> searchByCondition(@Param("offset") Integer offset,@Param("limit") Integer limit,@Param("dto") UserDto dto);

    Integer getTotal(@Param("dto") UserDto dto);

    User get(Integer userId);

    List<User> list(Integer roleId);

    Integer updateUserRoleId(@Param("userId") Integer userId,@Param("roleId") Integer roleId);

    List<User> searchDirector();

    Integer setPwdLiu(@Param("loginName")String loginName,@Param("password") String password);

    Integer updateInLiu(@Param("loginName")String loginName,@Param("brithday")String brithday, @Param("name")String name,@Param("sex")int sex,@Param("phone")String phone,@Param("headerimg")String headerimg ,@Param("address")String address);

    User getIndiv(@Param("loginName")String loginName);

    String getRole(@Param("roleId")int roleId);

}
